/*
 * Copyright 2009 Colin Prinn
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package net.recursv.motific.unittest;

import net.recursv.motific.unittest.assertion.*;

/**
 * Created by: recursv
 * Date: 31/07/2009
 * Time: 4:17:12 PM
 */
public class TestSuite {
    public static void assertEquals(int expected, int actual) {
        if (expected != actual)
            throw new EqualityAssertionException(expected, actual);
    }

    public static void assertEquals(String msg, int expected, int actual) {
        if (expected != actual)
            throw new EqualityAssertionException(msg, expected, actual);
    }

    public static void assertEquals(String expected, String actual) {
        if (!expected.equals(actual))
            throw new EqualityAssertionException(expected, actual);
    }

    public static void assertEquals(String msg, String expected, String actual) {
        if (!expected.equals(actual))
            throw new EqualityAssertionException(msg, expected, actual);
    }

    public static void assertEquals(Object expected, Object actual) {
        if (!expected.equals(actual))
            throw new EqualityAssertionException(expected, actual);
    }

    public static void assertEquals(String msg, Object expected, Object actual) {
        if (!expected.equals(actual))
            throw new EqualityAssertionException(msg, expected, actual);
    }

    public static void assertEquals(long expected, long actual) {
        if (expected != actual)
            throw new EqualityAssertionException(expected, actual);
    }

    public static void assertEquals(String msg, long expected, long actual) {
        if (expected != actual)
            throw new EqualityAssertionException(msg, expected, actual);
    }

    public static void assertTrue(boolean b) {
        if (!b)
            throw new BooleanAssertionException(true);
    }

    public static void assertTrue(String msg, boolean b) {
        if (!b)
            throw new BooleanAssertionException(msg, true);
    }

    public static void assertFalse(boolean b) {
        if (b)
            throw new BooleanAssertionException(false);
    }

    public static void assertFalse(String msg, boolean b) {
        if (b)
            throw new BooleanAssertionException(msg, false);
    }

    public static void fail(String msg) {
        throw new FailedAssertionException(msg);
    }

    public static void assertNull(Object o) {
        if (o != null)
            throw new NullAssertionException(o);
    }

    public static void assertSame(Object lhs, Object rhs) {
        if (lhs != rhs)
            throw new SameAssertionException(lhs, rhs);
    }


    public static void assertNotNull(Object o) {
        if (o == null)
            throw new NullAssertionException(o);
    }

    public static void assertNotSame(Object lhs, Object rhs) {
        if (lhs == rhs)
            throw new SameAssertionException(lhs, rhs);
    }


    public void beforeTest() throws Throwable {
    }

    public void afterTest() throws Throwable {
    }

    public void prepare() throws Throwable {
    }

    public void finalise() throws Throwable {
    }

}
